﻿ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="Web.Admin.Page.Edit" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>

<!DOCTYPE html>

<%="<!--[if IE 8]> <html class=\"ie8 no-js\"> <![endif]-->"%>
<%="<!--[if IE 9]> <html class=\"ie9 no-js\"> <![endif]-->"%>
<%="<!--[if !IE]><!-->"%>
<html>
<%="<!--<![endif]-->"%>
<!-- BEGIN HEAD -->

<head>
    <meta charset="utf-8" />
    <title><%=Evan.Common.CommFun.GetAppSetting("AdminTitle") %> - 后台管理系统</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <!-- #include file="../include/com_res_css.inc" -->
</head>
<!-- END HEAD -->

<body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white">
    <!-- BEGIN HEADER -->

    <!-- #include file="../include/top_bar.inc" -->

    <!-- END HEADER -->
    <!-- BEGIN HEADER & CONTENT DIVIDER -->
    <div class="clearfix"></div>
    <!-- END HEADER & CONTENT DIVIDER -->
    <!-- BEGIN CONTAINER -->
    <div class="page-container">
        <!-- BEGIN SIDEBAR -->

        <!-- #include file="../include/left_menu.inc" -->

        <!-- END SIDEBAR -->
        <!-- BEGIN CONTENT -->
        <div class="page-content-wrapper">
            <!-- BEGIN CONTENT BODY -->
            <div class="page-content">
                <!-- BEGIN PAGE HEADER-->
                <!-- BEGIN THEME PANEL -->
                <!-- #include file="../include/theme_panel.inc" -->
                <h3 class="page-title">内容管理</h3>
                <!-- END PAGE TITLE-->
                <!-- END PAGE HEADER-->
                <!-- BEGIN PAGE CONTENT-->

                <div class="portlet light bordered">
                    <div class="portlet-title tabbable-line">

                        <ul class="nav nav-tabs ">
                            <li class="active">
                                <a href="#tab_1" data-toggle="tab" aria-expanded="true">基本信息 </a>
                            </li>
                            <% bool HasSEO = !TableName.Equals("banner", StringComparison.OrdinalIgnoreCase) && !TableName.Equals("links", StringComparison.OrdinalIgnoreCase) && !TableName.Equals("feedback", StringComparison.OrdinalIgnoreCase); %>
                            <% if ((CurChannel.IsSeo == 1 || Evan_BLL.GetCurChannelHasRelease(CurChannel)) && HasSEO) 
                                { %>
                             <li class="">
                                <a href="#tab_2" data-toggle="tab" aria-expanded="false"> SEO信息 </a>
                            </li>
                            <%} %>
                        </ul>

                        <div class="caption">
                            <i class="glyphicon glyphicon-list-alt font-red"></i>
                            <span class="caption-subject font-red bold uppercase">内容管理</span>
                        </div>

                    </div>
                    <div class="tab-content">

                        <div class="tab-pane active" id="tab_1">
                            <div class="form">
                                <div class="form-horizontal form-row-seperated">
                                    <div class="form-body">
                                        <%--<div class="form-group">
                                            <label class="control-label col-md-2">列表显示标题</label>
                                            <div class="col-md-6">
                                                <input type="text" class="form-control" field="Title" placeholder="" field_type="input">
                                                <span class="help-block">列表显示标题</span>
                                            </div>
                                        </div>--%>

                                        <% foreach (Evan.Model.SysModel.HtmlHelperModel item in Html_List)
                                            {
                                                Response.Write(Evan.Common.HtmlHelper.HtmlBuild(item));
                                            }
                                        %>
                                    </div>
                                </div>
                            </div>
                        </div>
                         <div class="tab-pane" id="tab_2">
                                <div class="form">
                                    <div class="form-horizontal form-row-seperated">
                                        <div class="form-body">

                                            <%--<div class="form-group">
                                                <label class="control-label col-md-2">定时发布</label>
                                                <div class="col-md-6">
                                                    <div class="input-icon">
                                                        <i class="fa fa-calendar"></i>
                                                        <input type="text" readonly="" class="form-control date-picker-minute" maxlength="100" field="ReleaseTime" verify="notnull" field_type="time_minute" value="">
                                                    </div>
                                                    <span class="help-block">选择一个时间 , 该条信息将在此时间后展示出来 .</span>
                                                </div>
                                            </div>--%>

                                                <%
                                                    Evan.Model.SysModel.HtmlHelperModel ReleaseTime = new Evan.Model.SysModel.HtmlHelperModel { Title = "定时发布", PlaceHoder = "请选择时间", Notice = "选择一个时间 , 该条信息将在此时间后展示出来 .", FieldName = "ReleaseTime", FieldVerify = "", MaxLength = 100, FieldType = "time_minute", DefaultValue = "{DateTime_HHMM}" };
                                                    Evan.Model.SysModel.HtmlHelperModel SeoTitle = new Evan.Model.SysModel.HtmlHelperModel { Title = "SEO标题", PlaceHoder = "请输入Seo标题", Notice = "栏目SEO标题", FieldName = "SeoTitle", FieldVerify = "", MaxLength = 50, FieldType = "input" };
                                                    Evan.Model.SysModel.HtmlHelperModel SeoKeyWords = new Evan.Model.SysModel.HtmlHelperModel { Title = "SEO关键字", PlaceHoder = "请输入SEO关键字", Notice = "栏目SEO关键字", FieldName = "SeoKeyWords", FieldVerify = "", MaxLength = 150, FieldType = "input" };
                                                    Evan.Model.SysModel.HtmlHelperModel SeoDescription = new Evan.Model.SysModel.HtmlHelperModel { Title = "SEO描述", PlaceHoder = "请输入SEO描述", Notice = "栏目SEO描述", FieldName = "SeoDescription", FieldVerify = "", MaxLength = 300, FieldType = "textarea" };

                                                    if (Evan_BLL.GetCurChannelHasRelease(CurChannel))
                                                    {
                                                        Response.Write(Evan.Common.HtmlHelper.HtmlBuild(ReleaseTime));
                                                    }


                                                    if (CurChannel.IsSeo == 1)
                                                    {
                                                        Response.Write(Evan.Common.HtmlHelper.HtmlBuild(SeoTitle));
                                                        Response.Write(Evan.Common.HtmlHelper.HtmlBuild(SeoKeyWords));
                                                        Response.Write(Evan.Common.HtmlHelper.HtmlBuild(SeoDescription));
                                                    }

                                                %>
                                        </div>
                                    </div>
                                </div>
                            </div>
                    </div>


                    <div class="form-actions form-submit-row">
                        <div class="form-group">
                            <label class="control-label col-md-2"></label>
                            <div class="col-md-6">
                                <% if (Evan.Member.Administrator.HasRole(1, ClassId.ToString(), "", "update"))
                                    { %>
                                     <% if (TableName.ToLower() != "feedback")
                                         { %>
                                        <button type="button" class="btn green submit"><i class="fa fa-check"></i>&nbsp;&nbsp;提交</button>
                                    <%} %>
                                <%} %>
                                <button type="button" class="btn default" onclick="JumpList();"><i class="fa fa-mail-reply"></i>&nbsp;&nbsp;返回</button>
                            </div>
                        </div>

                        <%--侧边保存按钮--%>
                        <% if (Html_List.Count > 0)
                        { %>
                        <div style="position:fixed;z-index:10001; bottom:148px; right:20px; ">
                            <% if (Evan.Member.Administrator.HasRole(1, ClassId.ToString(), "", "update"))
                                { %>
                                <% if (TableName.ToLower() != "feedback"&&ClassId!=118)
                                    { %>
                                    <button type="button" class="btn green submit btn_submit_vertical"><i class="fa fa-check"></i><br/>提<br/>交</button><br/>
                                <% } %>
                            <%} %>
                            <button type="button" class="btn default" onclick="JumpList();" ><i class="fa fa-mail-reply"></i><br/>返<br/>回</button>
                        </div>
                        <% } %>

                        <div class="clear"></div>
                    </div>
                </div>


                <!-- END PAGE CONTENT-->
            </div>
            <!-- END CONTENT BODY -->
        </div>
        <!-- END CONTENT -->

    </div>
    <!-- END CONTAINER -->
    <!-- #include file="../include/footer.inc" -->
    <!-- #include file="../include/com_res_js.inc" -->

    <!-- feditor文件 -->
    <link rel="stylesheet" href="../assets/feditor/css/loadfeditor.css"  />
    <script type="text/javascript" src="../assets/feditor/js/loadfeditor.js"></script>
    <script type="text/javascript" src="../assets/global/plugins/RSAEncrypt/RSAEncrypt.min.js"></script>


    <script type="text/javascript">
        var publickey = "<%=new Evan.Encrypt.RSAEncrypt().PublicKeyModulus%>";
        var rsa = new RSAEncrypt(publickey);

        var model = <%=(Evan.Model.ConvertModel.ConvertToJson(Model))%>;
        model.ClassId = GetQs("classid");

        <%if (Model != null && Evan.Model.ConvertModel.HasKey(Model, "UserPwd"))
        {%>
        model["UserPwd"] = '<%=Evan.Common.CommFun.RePwd(Model.UserPwd)%>';
        <%}%>

        SetModel(model);
         <% if (TableName.ToLower() == "feedback")
        { %>
        $("input[field]").attr("disabled", "disabled");
        $("textarea[field]").attr("disabled", "disabled");
        $(".help-block").hide();
        <%} %>
    </script>
</body>

</html>
